package com.youpai.platform.biggod.web.api;

import com.youpai.platform.biggod.web.entity.req.*;
import com.youpai.platform.common.entity.resp.BaseResponse;
import com.youpai.platform.biggod.service.service.SkillExamineService;
import com.youpai.platform.biggod.web.entity.dto.SkillExamineDto;
import com.youpai.platform.biggod.web.entity.resp.SkillExamineResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 技能审核相关controller
 * @Author:huanghao
 * @Date:2022/11/13
 */
@Slf4j
@RestController
@RequestMapping(value = "/god/examine")
@Api(value = "SkillExamineController", tags = "技能审核相关")
public class SkillExamineController {

    @Resource
    private SkillExamineService skillExamineService;

    @ApiOperation(value = "新建技能审核")
    @PostMapping(value = "/create")
    public BaseResponse<SkillExamineResp> createCategory(@RequestBody SkillExamineAddReq req) {
        return BaseResponse.success(skillExamineService.createSkillExamine(req));
    }

    @ApiOperation(value = "修改技能审核")
    @PostMapping(value = "/update")
    public BaseResponse<SkillExamineResp> updateCategory(@RequestBody SkillExamineUpdateReq req) {
        return BaseResponse.success(skillExamineService.updateSkillExamine(req));
    }

    @ApiOperation(value = "获取单个技能审核详情")
    @PostMapping(value = "/get")
    public BaseResponse<SkillExamineDto> getCategory(@RequestBody SkillExamineGetReq req) {
        return BaseResponse.success(skillExamineService.getSkillExamine(req));
    }

    @ApiOperation(value = "获取技能审核列表")
    @PostMapping(value = "/getList")
    public BaseResponse<List<SkillExamineDto>> getCategoryList(@RequestBody SkillExamineListReq req) {
        return BaseResponse.success(skillExamineService.getSkillExamineList(req));
    }

    @ApiOperation(value = "删除技能审核")
    @PostMapping(value = "/remove")
    public BaseResponse<SkillExamineResp> removeCategory(@RequestBody SkillExamineRemoveReq req) {
        return BaseResponse.success(skillExamineService.removeSkillExamine(req));
    }

    @ApiOperation(value = "审核技能")
    @PostMapping(value = "/examineSkill")
    public BaseResponse<SkillExamineResp> examineSkill(@RequestBody SkillExamineReq req) {
        return BaseResponse.success(skillExamineService.examineSkill(req));
    }
}
